package ch.fusun.baron.player;

import java.util.Map;

import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.core.rmi.User;
import ch.fusun.baron.data.DataUpdate;
import ch.fusun.baron.player.api.PlayerService;

/**
 * 
 */
public class SetDynastiesUpdate implements DataUpdate {

	private Map<Dynasty, User> dynasties;
	@Inject
	private transient PlayerService playerService;

	/**
	 * Kryo
	 */
	public SetDynastiesUpdate() {
	}

	/**
	 * @param dynasties
	 *            The dynasties
	 */
	public SetDynastiesUpdate(Map<Dynasty, User> dynasties) {
		this.dynasties = dynasties;
	}

	@Override
	public void update() {
		playerService.setDynasties(dynasties);
	}

}
